// Author: wsfuyibing <682805@qq.com>
// Date: 2025-06-11

package responses

import (
	"server/app/http/models"
	"server/app/kind"
)

// UserResponse
// 用户信息.
type UserResponse struct {
	Gender     kind.Gender
	UserId     kind.UserId
	Mobile     kind.Mobile
	GenderText string
	Nickname   string
	Avatar     string
}

// With
// 数据绑定.
func (o *UserResponse) With(m *models.Users) *UserResponse {
	o.UserId = m.Id
	o.Mobile = m.Mobile
	o.Gender = m.Gender
	o.GenderText = m.Gender.Text()
	o.Nickname = m.Nickname
	o.Avatar = m.Avatar
	return o
}
